package com.junchao.peng.controller;

import com.junchao.peng.service.EmailService;
import com.junchao.peng.utils.JsonResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dell
 */
@RestController
@RequestMapping("/email")
public class EmailController {
    final EmailService emailService;

    public EmailController(EmailService emailService) {
        this.emailService = emailService;
    }

    @ApiOperation("发送会议通知给所有用户")
    @GetMapping("/sendEmailToAll")
    public JsonResult sendEmailToAll(Integer userId, String emailContent, String token){
        return emailService.sendEmailToAll(userId, emailContent, token);
    }
}
